package mybatis.sqlsession.defaults;

import mybatis.cfg.Configuration;
import mybatis.sqlsession.SqlSession;
import mybatis.sqlsession.SqlSessionFactory;

/**
 * 核心工厂实现类
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
  private Configuration config;

  public DefaultSqlSessionFactory(Configuration config) {
    this.config = config;
  }

  /**
   * 创建sqlSession
   * @return
   */
  public SqlSession openSession() {
    return new DefaultSqlSession(config);
  }
}
